import { BasicColumn } from '@/components/Table';
import { h } from 'vue';
import { DownOutlined } from '@ant-design/icons-vue';
// 自定义过滤图标的方法
// 定义 filterIcon 方法
const filterIcon = (filtered, onFilter, column) => {
  return h(DownOutlined, {
    style: {
      color: filtered ? '#209ee4' : undefined,
    },
    onClick: () => onFilter(null, column),
  });
};

//table
export const columns: BasicColumn[] = [
  {
    title: '面试官',
    dataIndex: 'times',
    key: 'times',
    customFilterDropdown: true,
    onFilter: (value, record) =>
      record.name.toString().toLowerCase().includes(value.toLowerCase()),
    onFilterDropdownOpenChange: (visible) => {
      if (visible) {
        console.log('12334');
      }
    },
    filterIcon,
  },
  {
    title: '状态',
    dataIndex: 'status',
    key: 'status',
    customFilterDropdown: true,
    onFilter: (value, record) =>
      record.name.toString().toLowerCase().includes(value.toLowerCase()),
    onFilterDropdownOpenChange: (visible) => {
      if (visible) {
        console.log('789');
      }
    },
    filterIcon,
  },
  {
    title: '面试数',
    dataIndex: 'a',
    key: 'a',
    sorter: true,
  },
  {
    title: '过面率',
    dataIndex: 'b',
    key: 'b',
    sorter: true,
  },
  {
    title: '面试到培数',
    dataIndex: 'c',
    key: 'c',
    sorter: true,
  },
  {
    title: '面试到培率',
    dataIndex: 'd',
    key: 'd',
    sorter: true,
  },
  {
    title: '面试过培数',
    dataIndex: 'e',
    key: 'e',
    sorter: true,
  },
  {
    title: '面试过赔率',
    dataIndex: 'f',
    key: 'f',
    sorter: true,
  }
];

